package web.java.a_listenerLife;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class RequestServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		/**
		 * 当执行一个Servlet时
		 * 1、调用ServletReqeuestListener监听器的requestInitialized方法
		 * 2、调用Servlet的方法体内容
		 * 3、销毁Servlet
		 * */
		System.out.println("启动一个Servlet便创建了Request");
		/*request.setAttribute("name","cainter");
		System.out.println("添加一个属性");
		request.setAttribute("name","monster");
		System.out.println("替换一个属性");
		request.removeAttribute("name");
		System.out.println("移除一个属性");*/
	}

}
